Display Foundry resources correctly in azd output - #6385
Conversation
- Add AzureResourceTypeCognitiveServiceAccountProject constant for Microsoft.CognitiveServices/accounts/projects - Update getCognitiveServiceResourceTypeDisplayName to detect Foundry projects by checking for /projects/ in resource ID - Update logic to show "Foundry" for AIServices and AIHub kinds instead of "Azure AI Services" - Add comprehensive tests for all Cognitive Services resource type display names - All tests pass, linting clean, spelling checked Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes the display names for Azure AI Foundry resources in azd output to match what users see in the Azure Portal. Previously, both Foundry hubs and Foundry projects were displayed as "Azure AI Services", causing confusion about which resources were provisioned.
Key Changes:
- Added detection logic for Foundry projects by checking for
/projects/in the resource ID path - Mapped
AIServicesandAIHubkinds to display as "Foundry" instead of generic "Azure AI Services" - Added
AzureResourceTypeCognitiveServiceAccountProjectconstant for the project resource type
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cli/azd/pkg/infra/azure_resource_manager.go | Added Foundry project path detection and kind-based mapping for AIServices/AIHub to display "Foundry" and "Foundry project" |
| cli/azd/pkg/azapi/azure_resource_types.go | Added new constant AzureResourceTypeCognitiveServiceAccountProject and its display name mapping |
| cli/azd/pkg/infra/azure_resource_manager_test.go | Added comprehensive test cases for Foundry hub (AIServices kind) and Foundry project resources |
- Change AIServices check from exact match to strings.Contains for consistency with other checks - Add test case for AIHub kind returning "Foundry" - Add test case using AzureResourceTypeCognitiveServiceAccountProject constant - Add support for capabilityHosts resource type (Microsoft.CognitiveServices/accounts/capabilityHosts) - Display capabilityHosts as "Foundry capability host" Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
- Handle AzureResourceTypeCognitiveServiceAccountProject directly in GetResourceTypeDisplayName - Return "Foundry project" immediately without API call when resource type is already known to be a project - Keep path-based check in getCognitiveServiceResourceTypeDisplayName for cases where resource type is account but ID points to project - Improves performance by avoiding unnecessary API calls for project resources Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
- Remove AzureResourceTypeCognitiveServiceAccountProject from condition routing - Let project resources use static display name mapping via fallback path - Remove path-based check for projects (not needed since resource type is correct) - Remove redundant test case (project resources always have correct type) - Cleaner, simpler code that relies on static mappings Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
|
/azp run azure-dev - cli |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
|
/check-enforcer override |

Plan: Add Foundry and Foundry Project display names to azd output
Microsoft.CognitiveServices/accountswithkind: 'AIServices'Microsoft.CognitiveServices/accounts/projects(child resource)kind: 'AIServices'but need to be distinguished by resource type pathazure_resource_manager.goto understand the pattern for distinguishing resource typesgetCognitiveServiceResourceTypeDisplayNameto add logic for Foundry detection:AzureResourceTypeCognitiveServiceAccountProjectfor project resource typeOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.